<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1" import="myclasses.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Address</title>
</head>
<body>
<% 	String residence = request.getParameter("residence");
	Student stud = (Student)session.getAttribute("student");
	stud.setResidence(residence); 
	
	/*OLD VERSION!
	String firstName = (String)session.getAttribute("firstName");
	String middleInitial = (String)session.getAttribute("middleInitial");
	String lastName = (String)session.getAttribute("lastName");
	String citizenship = (String)session.getAttribute("citizenship");
	*/
	%>

Name: <%= stud.getFirstName() %> <%= stud.getMiddleInitial() %>. <%= stud.getLastName() %>.<br>
Country of citizenship: <%= stud.getCitizenship() %>.<br>
County of residence: <%= residence %>.<br>

<form method="get" action="provideDegreesChooseLocation.jsp">
<%
if(residence != null)
{
	if(residence.equals("United States")) {
			out.println("Street: " + "<input type =\"text\" size=\"40\" name=\"street\" />" );
			out.println("<br>City: " + "<input type =\"text\" size=\"30\" name=\"city\" />" );
			out.println("<br>Sate: " + "<input type =\"text\" size=\"30\" name=\"state\" />" );
			out.println("<br>Zip code: " + "<input type =\"text\" size=\"5\" name=\"zip\" />" );
			out.println("<br>Area code:	" + "<input type =\"text\" size=\"4\" name=\"area\" />" );
			out.println("<br>Number: " + "<input type =\"text\" size=\"10\" name=\"number\" />" );
		}
	else
		out.println("<p>Country telephone code: " + "<input type =\"text\" size=\"5\" name=\"countryCode\" /></p>" );
}
%>
<br>
<input type="submit" value="Submit"/>
</form>
</body>
</html>